<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script src="./jquery.js"></script>
    <script>
        $(function() {
            function getMsg(callback) {
                $.get('http://www.liulongbin.top:3006/api/robot', {
                    spoken: '你好'
                }, function(res1) {
                    // console.log(res1);
                    callback(res1.data.info.text)

                })
            }

            function getVoice(callback, msg) {
                $.get('http://www.liulongbin.top:3006/api/synthesize', {
                    text: msg
                }, function(res2) {
                    // console.log(res2)
                    callback(res2)
                })
            }

            getMsg(function(msg) {
                getVoice(function(voice) {
                    console.log(voice);
                }, msg)
            })



        })
    </script>
</body>

</html>